﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using S4Store.Domain.SellerKpi;

namespace S4Store.Models.SellerKpi
{
    public class SellerListModel
    {
        public SellerListModel()
        {
            Sellers = new List<Domain.Employee>();
            CarBrands = new List<Domain.CarBrand>();
            SellerMonthConfigs = new List<SellerMonthConfig>();
        }

        public List<S4Store.Domain.Employee> Sellers { get; set; }
        public List<S4Store.Domain.CarBrand> CarBrands { get; set; }
        public List<SellerMonthConfig> SellerMonthConfigs { get; set; }

        public SellerMonthConfig GetSellerMonthConfig(int sellerid,int brandid)
        {
            var result=SellerMonthConfigs.FirstOrDefault(t => t.SellerId == sellerid&&t.CarBrandId==brandid);
            if(result==null)
            {
                result = new SellerMonthConfig();
            }
            return result;
        }
    }
}